#ifndef FASYS_LIBS_SUBSCRIBER_SUBSCRIPTION_HPP
#define FASYS_LIBS_SUBSCRIBER_SUBSCRIPTION_HPP

#include "types.hpp"

#include "channels/messages_channels.hpp"
#include "channels/channels_container.hpp"
#include "isubscriber.hpp"
#include "isubscription.hpp"

#include <set>

namespace fasys{ namespace subscriber{

class subscription
{
public:
  // TODO: добавить ограничить
  typedef ::fasys::channels::messages_channels messages_channels;
  typedef ::fasys::channels::channels_container channels_container;
  typedef std::set<channel_id_t> channel_id_set;
private:
  messages_channels* _channels;
  channels_container* _channels_container;
  channel_id_set _channel_ids;
public:
  ~subscription();
  subscription(channels_container* cc);
  // создать, обновить канал подпискиmin_size = 1, size_t max_size = 10
  channel_id_t create(const std::string& channel, size_t  );
  // удалить канал подписки
  channel_id_t remove(const std::string& channel);
  void publish(const message_notify& cmd);
  void publish(const message_list_response& cmd);
};

}}

#endif
